/******************************************************************************
 * @File name   :      PackageRedemptionLinesDaoImpl.java
 *
 * @Author      :      ANMA
 *
 * @Date        :      Aug 3, 2015
 *
 * @Copyright Notice: 
 * Copyright (c) 2014 DMS, Inc. All  Rights Reserved.
 * This software is published under the terms of the DMS Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * ----------------------------------------------------------------------------
 * Date                         Who         Version         Comments
 * Aug 3, 2015 5:05:19 PM    ANMA      1.0            Initial Version
 *****************************************************************************/
package com.cap.bts.crmdp.dealer.activation.dao.impl;

import java.util.List;

import javax.inject.Inject;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;

import com.cap.bts.crmdp.dealer.activation.dao.IPackageRedemptionLinesItemDao;
import com.cap.bts.crmdp.dealer.mars.domain.PackageRedemptionLinesItem;
import com.cap.bts.framework.common.dao.impl.BaseDaoImpl;
import com.cap.bts.framework.common.exception.AppException;

/**
 * 
 */
@Repository("packageRedemptionLinesItemDao")
public class PackageRedemptionLinesItemDaoImpl extends BaseDaoImpl<PackageRedemptionLinesItem, Long>implements IPackageRedemptionLinesItemDao {

	
	@Inject
	public PackageRedemptionLinesItemDaoImpl(@Value("com.cap.bts.crmdp.dealer.activation.domain.PackageRedemptionLines") Class<PackageRedemptionLinesItem> clazz) {
		super(clazz);
	}

    /**
     * {@inheritDoc} 
     * overridden:
     * @Date        :      Nov 3, 2015
     * @see com.cap.bts.crmdp.dealer.activation.dao.IPackageRedemptionLinesItemDao#getPackageRedemptionLinesItemListByTicketId(java.lang.Long)
    **/
    @Override
    public List<PackageRedemptionLinesItem> getPackageRedemptionLinesItemListByPackageIdAndTicketId(
        Long packageId
        ,Long ticketId) throws AppException {
        return super.getListByQueryWithVaParam("from PackageRedemptionLinesItem a where a.memberPackageInfo.id='"+packageId+"' and  a.ticket.id ='"+ticketId+"'");
    }

}
